package com.yuandian.management.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuandian.api.management.entity.ConfCustomExclusiveIndicator;
import com.yuandian.bpm.common.core.util.R;
import com.yuandian.bpm.common.security.util.SecurityUtils;
import com.yuandian.management.mapper.ConfCustomExclusiveIndicatorMapper;
import com.yuandian.management.service.ConfCustomExclusiveIndicatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 自定义专属指标字段表-Service实现
 * @author zfsn
 * @date 2023-6-7
 */
@Service
public class ConfCustomExclusiveIndicatorServiceImpl extends ServiceImpl<ConfCustomExclusiveIndicatorMapper, ConfCustomExclusiveIndicator>
		implements ConfCustomExclusiveIndicatorService {

	@Autowired
	private ConfCustomExclusiveIndicatorMapper confCustomExclusiveIndicatorMapper;
	/**
	 * 分页查询
	 *
	 * @param confCustomExclusiveIndicator 筛选条件
	 * @return 通用返回对象
	 */
	@Override
	public Page<ConfCustomExclusiveIndicator> listPage(ConfCustomExclusiveIndicator confCustomExclusiveIndicator) {
		return confCustomExclusiveIndicatorMapper.listPage(new Page<>(confCustomExclusiveIndicator.getPageNum(), confCustomExclusiveIndicator.getPageSize()), confCustomExclusiveIndicator);
	}

	/**
	 * 通过主键更新数据
	 *
	 * @param confCustomExclusiveIndicator 实例对象
	 * @return 通用返回对象
	 */
	@Override
	public R<String> updateDataById(ConfCustomExclusiveIndicator confCustomExclusiveIndicator) {
		super.updateById(confCustomExclusiveIndicator);
		return R.ok();
	}

	/**
	 * 新增数据
	 *
	 * @param confCustomExclusiveIndicator 实例对象
	 * @return 通用返回对象
	 */
	@Override
	public R<String> saveData(ConfCustomExclusiveIndicator confCustomExclusiveIndicator) {
		confCustomExclusiveIndicator.setCreateBy(SecurityUtils.getUser().getName());
		 super.save(confCustomExclusiveIndicator);
		return R.ok();
	}
}